import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
type Result = {
  data: {
    /** 列表数据 */
    list: Array<any>;
    total: number;
  };
  code: number; // 200 for success, others for error codes
  msg: string; // Response message
  success: string; // Whether the request was successful
};
/** 数据查询 */
export const exchange_query = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("exchange/query"), { data });
};
/** 公司额度 */
export const exchange_quota = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("exchange/quota"), { data });
};
/** 加盟商信息 */
export const company_info = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("company/info"), { data });
};
/** 按条件兑领 */
export const exchange_getByCondition = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("exchange/getByCondition"), { data });
};
/** 兑领记录 */
export const exchange_costlogs = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("exchange/costlogs"), { data });
};
/** 充值记录 */
export const exchange_chargelogs = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("exchange/chargelogs"), { data });
};
/** 任务详情 */
export const exchange_taskDetail = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("exchange/taskDetail"), { data });
};
